home *** CD-ROM | disk | FTP | other *** search
Text File | 1999-06-22 | 1.3 KB | 66 lines | [TEXT/CWIE] |
- // ===========================================================================
- // MetroNubUtils.c ©1996 Metrowerks Inc. All rights reserved.
- // ===========================================================================
-
- #ifndef __MetroNubUtils__
- #include "MetroNubUtils.h"
- #endif
-
- #ifndef __MetroNubUserInterface__
- #include "MetroNubUserInterface.h"
- #endif
-
- #ifndef __GESTALT__
- #include <Gestalt.h>
- #endif
-
-
- static MetroNubUserEntryBlock* gMetroNubEntry = NULL;
-
-
-
- Boolean IsMetroNubInstalled()
- {
- static Boolean lookedForMetroNub = false;
-
- if (! lookedForMetroNub)
- {
- long result;
- OSErr err;
-
- // look for MetroNub's Gestalt selector
- if (Gestalt(kMetroNubUserSignature, &result) == noErr)
- {
- MetroNubUserEntryBlock* block = (MetroNubUserEntryBlock *)result;
-
- // make sure the version of the API is compatible
- if (block->apiLowVersion <= kMetroNubUserAPIVersion &&
- kMetroNubUserAPIVersion <= block->apiHiVersion)
- gMetroNubEntry = block; // success!
- }
-
- lookedForMetroNub = true;
- }
-
- return (gMetroNubEntry != NULL);
- }
-
-
- Boolean IsMWDebuggerRunning()
- {
- if (IsMetroNubInstalled())
- return CallIsDebuggerRunningProc(gMetroNubEntry->isDebuggerRunning);
- else
- return false;
- }
-
-
-
- Boolean AmIBeingMWDebugged()
- {
- if (IsMetroNubInstalled())
- return CallAmIBeingDebuggedProc(gMetroNubEntry->amIBeingDebugged);
- else
- return false;
- }
-